package com.weixin1.service;

import com.weixin1.bean.News;
import com.weixin1.dao.NewsDao;

import java.sql.SQLException;
import java.util.List;

public class NewsService {
    NewsDao dao=new NewsDao();
    public List<News> list() throws SQLException {
        return dao.list();
    }
    public News getById(Long id) throws SQLException {
        return dao.getById(id);
    }
    public boolean save(News news) throws SQLException {
        return dao.save(news)>0;
    }
    public boolean removeById(Long id) throws SQLException {
        return dao.removeById(id)>0;
    }
    public boolean update(News news) throws SQLException {
        return dao.update(news)>0;
    }
    public List<News> selectByPage(int page, int limit) throws SQLException {
        return dao.selectByPage(page,limit);
    }
    public int gettotal() throws SQLException {
        return dao.gettotal();
    }
}
